/**
 * 路由相关demo
 */
import 'package:flutter_benchu/utils/commonPkg.dart';

class RouterDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _RouterDemoPageState();
}

class _RouterDemoPageState extends State<RouterDemoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('网页跳转')),
      body: Column(
        children: [
          InkWell(
            onTap: () {
              String title = '我是标题哦';
              String url = 'https://www.baidu.com/';
              //跳转 传参
              appRouter.navTo(context, Routes.routerDetailsDemo,param: {
                'title':title,
                'url':url,
                'widget':Text('我是文本widget'),
              }); 
              // appRouter.navigateTo(context, Routes.tab, replace: true);   // 跳转 无记录
            },
            child: Text(text(context, Ids.homeGoPage)), //切换页面
          ),
        ],
      ),
    );
  }
}
